home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-04d.zip
/
04d
/
Hity z okladki
/
Plus Firma
/
AccessRT
/
Office1.cab
/
OCP.SLL
/
pivot
/
pbpivot.scr
< prev
next >
Wrap
Text File
|
2003-10-09
|
50KB
|
2,068 lines
var m_phost;
var m_ilastdisp;
var m_aridisp;
var m_aridispRuntime;
var m_iseltype;
var m_fDesign;
var m_paridispUse;
var m_ppanels;
var m_pDSC;
var m_strConn;
var m_Selection;
var m_Selection0;
var m_strCommand;
var m_iDSC;
var m_strDataMember;
var m_finited = false;
function init()
{
m_ppanels = new Array();
m_phost = external.Host;
obpicker.This = obpicker;
m_ilastdisp = 0;
m_aridisp = new Array(0xF333,0x149D,0x141D,0x1015,0x15,0x11,0x11,0x11);
m_aridispRuntime = new Array(0x233,0x49D,0x41D,0x015,0x15,0x11,0x11,0x11);
initStdPair(mtbgen,mtbgenbar,fngenupdate,m_ppanels,fnnone);
initStdPair(mtbplformat,mdivplformatbar,fnplformatupdate,m_ppanels,fnformatinit);
initStdPair(mtbfiformat,mdivfiformatbar,fnfiformatupdate,m_ppanels,fnfiinit);
initStdPair(mtbcaption,mtbcaptionbar,fncapupdate,m_ppanels,fncapinit);
initStdPair(mtbshow,mtbshowbar,fnshowupdate,m_ppanels,fnshowinit);
initStdPair(mtbtotals,mtbtotalsbar,fntotalsupdate,m_ppanels,fntotalsinit);
initStdPair(mtbgrp,mtbgrpbar,fngrpupdate,m_ppanels,fngrpinit);
initStdPair(mtbsortfilter,mtbsortfilterbar,fnsfupdate,m_ppanels,fnsfinit);
initStdPair(mtbdsf,mtbdsfbar,fndsfupdate,m_ppanels,fndsfinit);
initStdPair(mtbaxis,mtbaxisbar,fnaxisupdate,m_ppanels,fnaxisinit);
initStdPair(mtbexp,mtbexpbar,fnexpupdate,m_ppanels,fnexpinit);
initStdPair(mtbgfformat,mtbgfformatbar,fngfupdate,m_ppanels,fngfinit);
initStdPair(mtbpladvanced,mdivpladvancedbar,fnadvupdate,m_ppanels,fnadvinit);
initStdPair(mtbtitleformat,mdivtitleformatbar,fntbupdate,m_ppanels,fntbinit);
initStdPair(mtbpac,mdivpac,fnpacupdate,m_ppanels,fnpacinit);
initStdPair(mtbdata,mtbdatabar,fndataupdate,m_ppanels,fndatainit);
if(document.dir == "rtl")
fninitrtl();
initStdBtn(imgtoolbar,1,fntoolbar);
initStdBtn(imgbold,1,fnbold);
initStdBtn(imgitalic,1,fnital);
initStdBtn(imgunderline,1,fnunderline);
initStdBtn(imgtitlebold,1,fntitlebold);
initStdBtn(imgtitleitalic,1,fntitleital);
initStdBtn(imgtitleunderline,1,fntitleunderline);
initStdBtn(imgpacbold,1,fncapbold);
initStdBtn(imgpacitalic,1,fncapital);
initStdBtn(imgpacunderline,1,fncapunderline);
initStdBtn(imgexpand,1,fnshowexpand);
initStdBtn(imgfieldlist,1,fnshowfieldlist);
initStdBtn(imgtitle,1,fnshowtitle);
initStdBtn(imghelp,0,fnhelp);
initStdBtn(imgdrop,1,fnshowdrop);
m_fDesign = external.UserMode;
if (m_fDesign)
m_paridispUse = m_aridisp;
else
m_paridispUse = m_aridispRuntime;
fnfiinit();
mtbfiformat.style.display = "";
mtbfiformat.Panel.style.display = "";
mtbfiformat.State = 1;
fnformatinit();
mtbplformat.style.display = "";
mtbplformat.Panel.style.display = "";
mtbplformat.State = 1;
m_ilastdisp=6;
AddOpenPanel(mtbplformat);
AddOpenPanel(mtbfiformat);
AddOpenPanel(mtbgen);
fnclearopts(slfontlist);
fnFontInit(slfontlist,m_phost);
fnclearopts(sltitlefontlist);
fnFontInit(sltitlefontlist,m_phost);
fnclearopts(slcapfontlist);
fnFontInit(slcapfontlist,m_phost);
document.body.onclick = fnclean;
m_finited = true;
SelectionChanged();
}
function fnclean()
{
obpicker.Close();
}
function fninitrtl()
{
var iln = m_ppanels.length;
for(var i=0;i < iln; i++)
{
var tarr = document.all(m_ppanels[i].id + "arr");
tarr.parentElement.align = "left";
}
tdfontlist.align = "right";
tdfontsize.align = "right";
tdtitlefontlist.align = "right";
tdtitlefontsize.align = "right";
tdcapfontlist.align = "right";
tdcapfontsize.align = "right";
}
function SelectionChanged()
{
if(!m_finited)
return;
if(external != null && external.Host != null)
{
m_phost = external.Host;
if(external.HostType != 2 || (external.UserMode ^ m_fDesign))
{
window.location.href= "../core/pbmain.htm";
return;
}
m_Selection = m_phost.Selection;
m_Selection0 = m_phost.Selection(0);
switch (fnWrapTypeName(m_Selection))
{
case "PivotView":
m_iseltype = 0;
fnselectdisp(m_paridispUse[0]);
fndispview();
break;
case "PivotFields":
m_iseltype = 1;
fnselectdisp(m_paridispUse[1]);
fndispfield();
break;
case "PivotTotals":
m_iseltype = 2;
fnselectdisp(m_paridispUse[2]);
fndisptot();
break;
case "PivotMembers":
if(m_Selection.Count == 1 && m_Selection0.IsTotal)
{
m_iseltype = 4;
fnselectdisp(m_paridispUse[4]);
fndispsub();
}
else
{
m_iseltype = 3;
fnselectdisp(m_paridispUse[3]);
fndispmem();
}
break;
case "PivotAggregates":
m_iseltype = 5;
fnselectdisp(m_paridispUse[5]);
inplSelection.value=divSelGen.innerText;
break;
case "PivotRange":
m_iseltype = 6;
fnselectdisp(m_paridispUse[6]);
inplSelection.value=divSelGen.innerText;
break;
case "PivotDetailRange":
m_iseltype = 7;
fnselectdisp(m_paridispUse[7]);
inplSelection.value=divSelGen.innerText;
break;
default:
m_iseltype = -1;
inplSelection.value=divSelNone.innerText;
if (m_fDesign)
{
fnselectdisp(0x9011);
}
else
{
fnselectdisp(0x11);
}
fnnothingsel();
break;
}
fnUpdate(m_ppanels);
fnsize();
fnclean();
fnbgcheck();
}
else
{
m_phost = null;
m_Selection = null;
m_Selection0 = null;
CollectGarbage();
}
}
function LostFocus()
{
if(external != null && external.Host != null)
{
var pae = document.activeElement;
if(pae != null)
{
var pfn = pae.Function;
if(pfn != null)
{
fnFocusState(false);
pfn();
fnFocusState(true);
}
}
}
}
function fnsize()
{
fninitsize(m_ppanels);
}
function fnformatinit()
{
initStdEdit(inpltitle,fnpltitle,false);
}
function fnfiinit()
{
initStdEdit(insfmtwd,fnsfmtwd,false);
}
function fncapinit()
{
initStdEdit(infldcap,fnfldcap,false);
initStdEdit(infldsetcap,fnfldsetcap,false);
}
function fnshowinit()
{
}
function fntotalsinit()
{
}
function fngrpinit()
{
}
function fnsfinit()
{
}
function fndsfinit()
{
initStdEdit(indsfmaxwd,fndsfmaxwd,false);
initStdEdit(indsfmaxht,fndsfmaxht,false);
initStdEdit(indsfwidth,fndsfwidth,false);
initStdEdit(indsfrwht,fndsfrwht,false);
}
function fnaxisinit()
{
}
function fnexpinit()
{
}
function fngfinit()
{
initStdEdit(ingfwidth,fngfwidthchange,false);
}
function fnadvinit()
{
initStdEdit(inadvmaxheight,fnadvheight,false);
initStdEdit(inadvmaxwidth,fnadvwidth,false);
initStdEdit(inplheight,fnplheight,false);
initStdEdit(inplwidth,fnplwidth,false);
}
function fntbinit()
{
}
function fnpacinit()
{
initStdEdit(inadvrowcap,fnadvrowcap,false);
initStdEdit(inadvcolcap,fnadvcolcap,false);
initStdEdit(inadvdatacap,fnadvdatacap,false);
initStdEdit(inadvfilcap,fnadvfilcap,false);
}
function fndatainit()
{
initStdEdit(inadvconn,fnadvconn,false);
initStdEdit(inadvcommand,fnadvcommand,false);
}
function fndispmem()
{
divtotadv.style.display = "none";
divpladv.style.display = "none";
divfiadv.style.display = "none";
divmemadv.style.display = "";
tdfflabel.innerText = divFormat.innerText;
tdexptab.innerHTML = divTotFunc.innerText;
tbfun.style.display = "";
tbfldcap.style.display = "none";
tbcap.style.display = "";
tbcapalign.style.display = "none";
tbsfmtfont.style.display = "";
tbsfmtfont2.style.display = "";
tbsfmtbg.style.display = "";
tbsfmtalign.style.display = "";
tbsfmtnfmt.style.display = "none";
tbsfmtsize.style.display = "none";
inplSelection.value = divSelItem.innerText;
}
function fndispsub()
{
tdfflabel.innerHTML = divFormat.innerText;
tbsfmtfont.style.display = "";
tbsfmtfont2.style.display = "";
tbsfmtbg.style.display = "";
tbsfmtalign.style.display = "none";
tbsfmtnfmt.style.display = "none";
tbsfmtsize.style.display = "none";
inplSelection.value=divSelSubtot.innerText;
}
function fndisptot()
{
tdcaplab.innerHTML = divTotCap.innerText;
divtotadv.style.display = "";
divpladv.style.display = "none";
divfiadv.style.display = "none";
divmemadv.style.display = "none";
var psel = m_Selection0;
if(m_iseltype == 2)
{
tbfun.style.display = "";
tdexptab.innerHTML = divTotFunc.innerText;
}
tdfflabel.innerText = divFormat.innerText;
tbfldcap.style.display = "none";
tbcap.style.display = "";
tbcapalign.style.display = "";
tbsfmtfont.style.display = "";
tbsfmtfont2.style.display = "";
tbsfmtbg.style.display = "";
tbsfmtalign.style.display = "";
tbsfmtnfmt.style.display = "";
tbsfmtsize.style.display = "";
inplSelection.value=divSelTots.innerText;
if(m_phost.ProviderType == 3 || m_iseltype == 1)
{
mtbexp.style.display ="none";
mtbexp.Panel.style.display ="none";
m_ilastdisp = m_ilastdisp & (0xFFFF - (1 << mtbexp.Index));
}
tbfmtlabel.width = 126;
}
function fnnothingsel()
{
mtbfiformat.style.display ="none";
mtbfiformat.Panel.style.display ="none";
m_ilastdisp = m_ilastdisp & (0xFFFF - (1 << mtbfiformat.Index));
divtotadv.style.display = "none";
divpladv.style.display = "";
divfiadv.style.display = "none";
divmemadv.style.display = "none";
}
function fndispview()
{
divtotadv.style.display = "none";
divpladv.style.display = "";
divfiadv.style.display = "none";
divmemadv.style.display = "none";
mtbfiformat.style.display ="none";
mtbfiformat.Panel.style.display ="none";
m_ilastdisp = m_ilastdisp & (0xFFFF - (1 << mtbfiformat.Index));
tdfflabel.innerText = divFiLabFormat.innerText;
if(m_phost.ProviderType != 2)
{
mtbdsf.style.display ="none";
mtbdsf.Panel.style.display ="none";
m_ilastdisp = m_ilastdisp & (0xFFFF - (1 << mtbdsf.Index));
}
tbplshow.style.display = "";
tbplshow2.style.display = "";
tbplshow3.style.display = "";
tbsfmtfont.style.display = "";
tbsfmtfont2.style.display = "";
tbsfmtbg.style.display = "";
tbsfmtalign.style.display = "none";
tbsfmtnfmt.style.display = "none";
tbsfmtsize.style.display = "none";
inplSelection.value=divSelPL.innerText;
}
function fndispfield()
{
var pfs = m_Selection0.FieldSet;
var psel = m_Selection0;
tdfflabel.innerHTML = divFormat.innerText;
tdcaplab.innerHTML = divCaps.innerText;
divtotadv.style.display = "none";
divpladv.style.display = "none";
divfiadv.style.display = "";
divmemadv.style.display = "none";
tbplshow.style.display = "";
tbplshow2.style.display = "";
tbplshow3.style.display = "";
tbcap.style.display = "";
tbfldcap.style.display = "";
tbcapalign.style.display = "none";
{
mtbexp.style.display = "none";
mtbexp.Panel.style.display = "none";
m_ilastdisp = m_ilastdisp & (0xFFFF - (1 << mtbexp.Index));
}
if(pfs.Orientation & 3)
{
tbsfmtalign.style.display = "none";
tbsfmtnfmt.style.display = "none";
tbsfmtsize.style.display = "";
mtbsortfilter.style.display = "";
tbfmtlabel.width = 86;
if (pfs.Orientation & 1)
inplSelection.value=divSelColF.innerText;
else
inplSelection.value=divSelRowF.innerText;
}
else
{
if(pfs.Orientation & 4)
{
tbsfmtalign.style.display = "none";
tbsfmtnfmt.style.display = "none";
tbsfmtsize.style.display = "none";
inplSelection.value=divSelFilter.innerText;
mtbsortfilter.style.display = "none";
mtbsortfilter.Panel.style.display = "none";
m_ilastdisp = m_ilastdisp & (0xFFFF - (1 << mtbsortfilter.Index));
mtbgfformat.style.display = "none";
mtbgfformat.Panel.style.display = "none";
m_ilastdisp = m_ilastdisp & (0xFFFF - (1 << mtbgfformat.Index));
}
else
{
inplSelection.value=divSelDetailF.innerText;
tbfmtlabel.width = 126;
tbsfmtalign.style.display = "";
tbsfmtnfmt.style.display = "";
tbsfmtsize.style.display = "";
mtbsortfilter.style.display = "";
}
}
tbsfmtfont.style.display = "";
tbsfmtfont2.style.display = "";
tbsfmtbg.style.display = "";
}
function fnpivotaddopts(control, string, value)
{
var opt;
opt = document.createElement("OPTION");
opt.text = string;
opt.value = value;
control.options.add(opt);
}
function fngrpupdate()
{
}
function fnpacupdate()
{
var prc = m_phost.ActiveView.RowAxis.Label;
var pcc = m_phost.ActiveView.ColumnAxis.Label;
var pdc = m_phost.ActiveView.DataAxis.Label;
var pfc = m_phost.ActiveView.FilterAxis.Label;
inadvrowcap.value = prc.Caption;
inadvcolcap.value = pcc.Caption;
inadvfilcap.value = pfc.Caption;
inadvdatacap.value = pdc.Caption;
var ffnt = true;
if(!prc.Font.Bold || !pcc.Font.Bold || !pdc.Font.Bold || !pfc.Font.Bold)
ffnt = false;
fnBtnUpdate(imgpacbold,ffnt);
ffnt = true;
if(!prc.Font.Italic || !pcc.Font.Italic || !pdc.Font.Italic || !pfc.Font.Italic )
ffnt = false;
fnBtnUpdate(imgpacitalic ,ffnt);
ffnt = true;
if(!prc.Font.Underline || !pcc.Font.Underline || !pdc.Font.Underline || !pfc.Font.Underline )
ffnt = false;
fnBtnUpdate(imgpacunderline ,ffnt);
if((prc.Font.Name == pcc.Font.Name) && (pdc.Font.Name == pfc.Font.Name) && (prc.Font.Name == pfc.Font.Name))
fnsetselect(prc.Font.Name,slcapfontlist);
if((prc.Font.Size == pcc.Font.Size) && (pdc.Font.Size == pfc.Font.Size) && (prc.Font.Size == pfc.Font.Size ))
fnsetselect(prc.Font.Size ,slcapfontsize);
}
function fnadvupdate()
{
var psel;
if (m_iseltype > 0)
{
psel = m_Selection0;
}
if(m_iseltype == 0 || m_iseltype == -1)
{
idadvdet.checked = m_phost.AllowDetails;
inadvfil.checked = !m_phost.AllowFiltering;
inadvgrp.checked = !m_phost.AllowGrouping;
inadvprop.checked = m_phost.AllowPropertyToolbox ;
inadvautofit.checked = m_phost.AutoFit;
inadvmaxheight.value = external.DecodeNumber(m_phost.MaxHeight);
inadvmaxwidth.value = external.DecodeNumber(m_phost.MaxWidth);
inplheight.value = external.DecodeNumber(m_phost.Height);
inplwidth.value = external.DecodeNumber(m_phost.Width);
if (m_phost.HasDetails)
inadvdetavail.innerHTML = divYes.innerText;
else
inadvdetavail.innerHTML = divNo.innerText;
inadvrtl.checked = m_phost.RightToLeft;
inmemadvae.value = m_phost.MemberExpand;
}
else
{
if(m_iseltype == 1)
{
var pfs = psel.FieldSet;
if(pfs == null)
return;
tdadvfibfn.innerHTML = psel.BaseName;
tdadvfidf.innerHTML = psel.DataField;
tdadvfidt.innerHTML = fnDataTypeStr(psel.DataType);
tdadvfifn.innerHTML = psel.Name;
tdadvfift.innerHTML = fnFieldTypeStr(psel.Type);
tdadvfifst.innerHTML = fnFieldSetTypeStr(pfs.Type);
tdadvfifsn.innerHTML = psel.FieldSet.Name;
tdadvfifsc.innerHTML = fnFieldSetOrientation(pfs.Orientation);
}
else
{
if(m_iseltype == 2)
{
if (psel.Field != null)
tdadvtottsf.innerHTML = psel.Field.DataField;
tdadvtottn.innerHTML = psel.Name;
tdadvtottt.innerHTML = fnFieldTypeStr(psel.Type);
}
else
{
if(m_iseltype == 3)
{
tdadvmemname.innerHTML = psel.Name;
tdadvmemuiquename.innerHTML = psel.UniqueName;
initemcap.innerHTML = psel.Caption;
}
}
}
}
}
var fInDataUpdate;
function fndataupdate()
{
inadvconn.value = m_phost.ConnectionString;
fInDataUpdate = true;
fnpopulatedatasources();
fInDataUpdate = false;
}
function fntbupdate()
{
var pfn = m_phost.ActiveView.TitleBar.Font;
fnBtnUpdate(imgtitlebold,pfn.Bold);
fnBtnUpdate(imgtitleitalic,pfn.Italic);
fnBtnUpdate(imgtitleunderline,pfn.Underline);
fnsetselect(pfn.Name,sltitlefontlist);
fnsetselect(pfn.Size,sltitlefontsize);
}
function fnaxisupdate()
{
inemprowb.checked = m_phost.ActiveView.RowAxis.DisplayEmptyMembers;
inempcolb.checked = m_phost.ActiveView.ColumnAxis.DisplayEmptyMembers;
}
function fnexpupdate()
{
var psel = m_Selection0;
var enumDataType;
if(m_iseltype == 2)
{
enumDataType = psel.Field.DataType;
fnclearopts(slfunc);
if (IsFunctionValid(enumDataType, 1))
fnpivotaddopts(slfunc, divTotSum.innerText,1);
if (IsFunctionValid(enumDataType, 2))
fnpivotaddopts(slfunc, divTotCount.innerText,2);
if (IsFunctionValid(enumDataType, 3))
fnpivotaddopts(slfunc, divTotMin.innerText,3);
if (IsFunctionValid(enumDataType, 4))
fnpivotaddopts(slfunc, divTotMax.innerText,4);
fnsetselect(psel.Function,slfunc);
}
}
function fnsfupdate()
{
var psel = m_Selection0;
var pfn;
fnsetselect(psel.SortDirection,slsortdir);
}
function fndsfupdate()
{
var psel = m_Selection;
indsfrwht.value = external.DecodeNumber(psel.DetailRowHeight);
indsfautofit.checked = psel.DetailAutoFit;
indsfwidth.value = external.DecodeNumber(psel.DetailWidth);
indsfmaxwd.value = external.DecodeNumber(psel.DetailMaxWidth);
indsfmaxht.value = external.DecodeNumber(psel.DetailMaxHeight);
}
function fngfupdate()
{
var psel = m_Selection0;
ingfautofit.checked = psel.GroupedAutoFit;
ingfwidth.value = external.DecodeNumber(psel.GroupedWidth);
}
function fnfiformatupdate()
{
if (m_iseltype > 4)
return;
pfn = fnfontsel();
if(typeof(pfn.Count) == "number")
{
fnBtnUpdate(imgbold,fnfontswitch(pfn(0)).Bold);
fnBtnUpdate(imgitalic,fnfontswitch(pfn(0)).Italic);
fnBtnUpdate(imgunderline,fnfontswitch(pfn(0)).Underline);
fnsetselect(fnfontswitch(pfn(0)).Name,slfontlist);
fnsetselect(fnfontswitch(pfn(0)).Size,slfontsize);
}
else
{
fnBtnUpdate(imgbold,fnfontswitch(pfn).Bold);
fnBtnUpdate(imgitalic,fnfontswitch(pfn).Italic);
fnBtnUpdate(imgunderline,fnfontswitch(pfn).Underline);
fnsetselect(fnfontswitch(pfn).Name,slfontlist);
fnsetselect(fnfontswitch(pfn).Size,slfontsize);
}
if(m_iseltype == 1)
{
fnsetselect(m_Selection0.NumberFormat,slnfmt);
fnsetselect(m_Selection0.DetailHAlignment,slhalign);
}
else if(m_iseltype == 2)
{
fnsetselect(m_Selection0.NumberFormat,slnfmt);
fnsetselect(m_Selection0.HAlignment,slhalign);
}
else if (m_iseltype == 3)
{
fnsetselect(m_phost.ActiveView.MemberHAlignment,slhalign);
}
if(m_iseltype == 1)
{
if (m_Selection0.FieldSet.Orientation & 7)
{
insfautofit.checked = m_Selection0.GroupedAutoFit;
insfmtwd.value = external.DecodeNumber(m_Selection0.GroupedWidth);
}
else
{
insfmtwd.value = external.DecodeNumber(m_Selection0.DetailWidth);
insfautofit.checked = m_Selection0.DetailAutoFit;
}
}
else
{
if(m_iseltype == 2)
{
insfmtwd.value = external.DecodeNumber(m_Selection0.Width);
insfautofit.checked = m_Selection0.AutoFit;
}
}
}
function fnplformatupdate()
{
inpltitle.value= m_phost.ActiveView.TitleBar.Caption;
fnsetselect(m_phost.ActiveView.TotalOrientation,sltotalori);
}
function fntotalsupdate()
{
var psel=m_Selection;
inflsub.checked = psel.TotalAllMembers;
fnsetselect(psel.TotalOrientation,sltotalori);
}
function fngenupdate()
{
}
function fnshowupdate()
{
fnBtnUpdate(imgexpand,m_phost.DisplayExpandIndicator);
fnBtnUpdate(imgfieldlist,m_phost.DisplayFieldList);
fnBtnUpdate(imgtoolbar,m_phost.DisplayToolbar);
if (m_phost.ActiveView != null)
{
tbplshowtitle.style.display = "";
tbplshowdrop.style.display = "";
fnBtnUpdate(imgtitle,m_phost.ActiveView.Label.Visible);
f1 = m_phost.ActiveView.RowAxis.Label.Visible;
f2 = m_phost.ActiveView.ColumnAxis.Label.Visible;
f3 = m_phost.ActiveView.FilterAxis.Label.Visible;
f4 = m_phost.ActiveView.DataAxis.Label.Visible;
fSet = (f1 || f2 || f3 || f4);
fnBtnUpdate(imgdrop,fSet);
}
else
{
tbplshowtitle.style.display = "none";
tbplshowdrop.style.display = "none";
}
}
function fncapupdate()
{
var psel = m_Selection0;
if(psel.FieldSet != null)
infldsetcap.value = psel.FieldSet.Caption;
infldcap.value = psel.Caption;
if(m_iseltype == 2)
fnsetselect(psel.CaptionHAlignment,slcapalign);
else
fnsetselect(psel.CaptionAlignment,slcapalign);
}
function fntoolbar()
{
var fnewstate = !(m_phost.DisplayToolbar);
m_phost.DisplayToolbar = fnewstate;
fnerrorchk(m_phost);
fnBtnUpdate(imgtoolbar,fnewstate);
}
function fnhelp()
{
external.ShowHelp(0);
}
function fnplcolor()
{
m_phost.BackColor = tdplbox.style.backgroundColor;
fnerrorchk(m_phost);
}
function fnplheight()
{
m_phost.Height = inplheight.value;
inadvautofit.checked = false;
fnerrorchk(m_phost);
}
function fnplwidth()
{
m_phost.Width = inplwidth.value;
inadvautofit.checked = false;
fnerrorchk(m_phost);
}
function fnpltitle()
{
var ptitle = m_phost.ActiveView.TitleBar;
ptitle.Caption = inpltitle.value;
fnerrorchk(ptitle);
}
function fnshowtitle()
{
m_phost.ActiveView.Label.Visible = !(m_phost.ActiveView.Label.Visible);
fnerrorchk(m_phost);
}
function fnshowexpand()
{
m_phost.DisplayExpandIndicator = !(m_phost.DisplayExpandIndicator);
fnerrorchk(m_phost);
}
function fnshowdrop()
{
f1 = m_phost.ActiveView.RowAxis.Label.Visible;
f2 = m_phost.ActiveView.ColumnAxis.Label.Visible;
f3 = m_phost.ActiveView.FilterAxis.Label.Visible;
f4 = m_phost.ActiveView.DataAxis.Label.Visible;
fSet = !(f1 || f2 || f3 || f4);
m_phost.ActiveView.RowAxis.Label.Visible = fSet;
m_phost.ActiveView.ColumnAxis.Label.Visible = fSet;
m_phost.ActiveView.FilterAxis.Label.Visible = fSet;
m_phost.ActiveView.DataAxis.Label.Visible = fSet;
fnerrorchk(m_phost);
}
function fnshowfieldlist()
{
m_phost.DisplayFieldList = !(m_phost.DisplayFieldList);
fnerrorchk(m_phost);
}
function fnsubtotalflmem()
{
event.cancelBubble = true;
var psel = m_Selection;
psel.TotalAllMembers = inflsub.checked;
fnerrorchk(psel);
inflsub.checked = psel.TotalAllMembers;
}
function fntotalorichange()
{
var psel = m_Selection;
psel.TotalOrientation = sltotalori.value;
fnerrorchk(psel);
}
function fndetexp()
{
event.cancelBubble = true;
var psel = m_Selection;
fnerrorchk(psel);
}
function fndsfrwht()
{
var psel = m_Selection;
psel.DetailRowHeight = indsfrwht.value;
fnerrorchk(psel);
}
function fndsfautofit()
{
event.cancelBubble = true;
var psel = m_Selection;
psel.DetailAutoFit = indsfautofit.checked;
fnerrorchk(psel);
indsfautofit.checked = psel.DetailAutoFit;
}
function fndsfwidth()
{
var psel= m_Selection;
psel.DetailWidth = indsfwidth.value;
fnerrorchk(psel);
indsfautofit.checked = false;
}
function fndsfmaxwd()
{
var psel= m_Selection;
psel.DetailMaxWidth = indsfmaxwd.value;
fnerrorchk(psel);
}
function fndsfmaxht()
{
var psel= m_Selection;
psel.DetailMaxHeight = indsfmaxht.value;
fnerrorchk(psel);
}
function fnfont()
{
}
function fnhidefield()
{
}
function fnfldsetcap()
{
var i;
var psel = m_Selection;
var pselItem;
for(i=0;i < psel.Count;i++)
{
pselItem = psel(i);
pselItem.FieldSet.Caption = infldsetcap.value;
fnerrorchk(pselItem);
}
}
function fnfldcap()
{
var i;
var psel = m_Selection;
var pselItem;
for(i=0;i < psel.Count;i++)
{
pselItem = psel(i);
pselItem.Caption = infldcap.value;
fnerrorchk(pselItem);
}
}
function fnsortdir()
{
var i;
var psel = m_Selection;
var pselItem;
for(i=0;i < psel.Count;i++)
{
pselItem = psel(i);
pselItem.SortDirection = slsortdir.value;
fnerrorchk(pselItem);
}
}
function fnfunc()
{
var i;
var psel = m_Selection;
var pselItem;
for(i=0;i < psel.Count;i++)
{
pselItem = psel(i);
pselItem.Function = slfunc.value;
fnerrorchk(pselItem);
}
}
function fnemprowb()
{
m_phost.ActiveView.RowAxis.DisplayEmptyMembers = inemprowb.checked;
}
function fnempcolb()
{
m_phost.ActiveView.ColumnAxis.DisplayEmptyMembers = inempcolb.checked;
}
function fnback()
{
var psel = fnfontsel();
var c = psel.Count;
var pfnt;
if(typeof(c) == "number")
{
for (i = 0; i < c;i++)
{
pfnt = fnbgswitch(psel(i),tdbackbox.style.backgroundColor);
fnerrorchk(pfnt);
}
}
else
{
pfnt = fnbgswitch(psel,tdbackbox.style.backgroundColor);
fnerrorchk(pfnt);
}
}
function fnfont()
{
var psel = fnfontsel();
var pfnt;
var c = psel.Count;
if(typeof(c) == "number")
{
for (i = 0; i < c;i++)
{
pfnt = fnfontswitch(psel(i));
pfnt.Color = tdfontbox.style.backgroundColor;
fnerrorchk(pfnt);
}
}
else
{
pfnt = fnfontswitch(psel);
pfnt.Color = tdfontbox.style.backgroundColor;
fnerrorchk(pfnt);
}
}
function fnbold()
{
var psel = fnfontsel();
var c = psel.Count;
if(typeof(c) == "number")
{
var fbold = false;
for (i = 0; i < c;i++)
{
var pfnt = fnfontswitch(psel(i));
if(!pfnt.Bold)
{
fbold = true;
break;
}
}
for (i = 0; i < c;i++)
{
var pfnt = fnfontswitch(psel(i));
pfnt.Bold = fbold;
fnerrorchk(pfnt);
}
}
else
{
var pfnt = fnfontswitch(psel);
var fbold = !(pfnt.Bold);
pfnt.Bold = !(pfnt.Bold);
fnerrorchk(pfnt);
}
}
function fnunderline()
{
var psel = fnfontsel();
var c = psel.Count;
var fnt;
if(typeof(c) == "number")
{
var ful = false;
for (i = 0; i < c;i++)
{
pfnt = fnfontswitch(psel(i));
if(!pfnt.Underline)
{
ful = true;
break;
}
}
for (i = 0; i < c;i++)
{
pfnt = fnfontswitch(psel(i));
pfnt.Underline = ful;
if (ful)
pfnt.Underline = 1;
else
pfnt.Underline = 0;
fnerrorchk(pfnt);
}
}
else
{
pfnt = fnfontswitch(psel);
if (pfnt.Underline)
pfnt.Underline = 0;
else
pfnt.Underline = 1;
fnerrorchk(pfnt);
}
}
function fnital()
{
var psel = fnfontsel();
var c = psel.Count;
if(typeof(c) == "number")
{
var fital = false;
for (i = 0; i < c;i++)
{
var pfnt = fnfontswitch(psel(i));
if(!pfnt.Italic)
{
fital = true;
break;
}
}
for (i = 0; i < c;i++)
{
var pfnt = fnfontswitch(psel(i));
pfnt.Italic = fital;
fnerrorchk(pfnt);
}
}
else
{
var pfnt = fnfontswitch(psel);
pfnt.Italic = !(pfnt.Italic);
fnerrorchk(pfnt);
}
}
function fnfontcng()
{
var psel = fnfontsel();
var c = psel.Count;
if(typeof(c) == "number")
{
for (i = 0; i < c;i++)
{
var pfnt = fnfontswitch(psel(i));
pfnt.Name = slfontlist.value;
fnerrorchk(pfnt);
}
}
else
{
var pfnt = fnfontswitch(psel);
pfnt.Name = slfontlist.value;
fnerrorchk(pfnt);
}
}
function fnfontsize()
{
var psel = fnfontsel();
var c = psel.Count;
if(typeof(c) == "number")
{
for (i = 0; i < c;i++)
{
var pfnt = fnfontswitch(psel(i));
pfnt.Size = slfontsize.value;
fnerrorchk(pfnt);
}
}
else
{
var pfnt = fnfontswitch(psel);
pfnt.Size = slfontsize.value;
fnerrorchk(pfnt);
}
}
function fncapalign()
{
var psel = m_Selection;
var c = psel.Count;
var pselItem;
for (i = 0;i < c;i++)
{
pselItem = psel(i);
pselItem.CaptionHAlignment = slcapalign.value;
fnerrorchk(pselItem);
}
}
function fnhalignchange()
{
var psel = fnalignsel();
var c = psel.Count;
var pfnt;
if(typeof(c) == "number")
{
for (i = 0; i < c;i++)
{
pfnt = fnhalignswitch(psel(i),slhalign.value);
fnerrorchk(pfnt);
}
}
else
{
pfnt = fnhalignswitch(psel,slhalign.value);
fnerrorchk(pfnt);
}
}
function fnvalignchange()
{
var psel = fnalignsel();
var c = psel.Count;
var pfnt;
if(typeof(c) == "number")
{
for (i = 0; i < c;i++)
{
pfnt = fnvalignswitch(psel(i),slvalign.value);
fnerrorchk(pfnt);
}
}
else
{
pfnt = fnvalignswitch(psel,slvalign.value);
fnerrorchk(pfnt);
}
}
function fnnumfmtchange()
{
var psel = m_Selection;
var c = psel.Count;
var pselItem;
for (i = 0;i < c;i++)
{
pselItem = psel(i);
pselItem.NumberFormat = slnfmt.value;
fnerrorchk(pselItem);
}
}
function fnsfmtwd()
{
var psel = m_Selection;
var c = psel.Count
var pselItem;
if(m_iseltype == 1)
{
for(i=0;i<c;i++)
{
pselItem = psel(i);
if (pselItem.FieldSet.Orientation & 7)
pselItem.GroupedWidth = insfmtwd.value;
else
pselItem.DetailWidth = insfmtwd.value;
insfautofit.checked = false;
fnerrorchk(pselItem);
}
}
else
{
if(m_iseltype == 2)
{
for(i=0;i<c;i++)
{
pselItem = psel(i);
pselItem.Width = insfmtwd.value;
fnerrorchk(pselItem);
}
insfautofit.checked = false;
}
}
}
function fnsfautofit()
{
event.cancelBubble = true;
var psel = m_Selection;
var c = psel.Count
var pselItem;
if(m_iseltype == 1)
{
for(i=0;i<c;i++)
{
pselItem = psel(i);
if (pselItem.FieldSet.Orientation & 7)
{
pselItem.GroupedAutoFit = insfautofit.checked;
insfmtwd.value = external.DecodeNumber(pselItem.GroupedWidth);
}
else
{
pselItem.DetailAutoFit = insfautofit.checked;
insfmtwd.value = external.DecodeNumber(pselItem.DetailWidth);
}
fnerrorchk(pselItem);
}
}
else
{
if(m_iseltype == 2)
{
for(i=0;i<c;i++)
{
pselItem = psel(i);
pselItem.AutoFit = insfautofit.checked;
fnerrorchk(pselItem);
insfmtwd.value = external.DecodeNumber(pselItem.Width);
}
}
}
}
function fntitlefont()
{
var psel = m_phost.ActiveView.TitleBar.Font;
psel.Color = tdtitlefontbox.style.backgroundColor;
fnerrorchk(psel);
}
function fntitlebold()
{
var psel = m_phost.ActiveView.TitleBar.Font;
psel.Bold = !(psel.Bold);
fnerrorchk(psel);
}
function fntitleital()
{
var psel = m_phost.ActiveView.TitleBar.Font;
psel.Italic = !(psel.Italic);
fnerrorchk(psel);
}
function fntitleunderline()
{
var psel = m_phost.ActiveView.TitleBar.Font;
if (psel.Underline)
psel.Underline = 0;
else
psel.Underline = 1;
fnerrorchk(psel);
}
function fntitlefontcng()
{
var psel = m_phost.ActiveView.TitleBar.Font;
psel.Name = sltitlefontlist.value;
fnerrorchk(psel);
}
function fntitlefontsize()
{
var psel = m_phost.ActiveView.TitleBar.Font;
psel.Size = sltitlefontsize.value;
fnerrorchk(psel);
}
function fntitleback()
{
var psel = m_phost.ActiveView.TitleBar;
psel.BackColor = tdtitlebackbox.style.backgroundColor;
fnerrorchk(psel);
}
function fnadvrowcap()
{
var psel = m_phost.ActiveView.RowAxis.Label;
psel.Caption = inadvrowcap.value;
fnerrorchk(psel);
}
function fnadvcolcap()
{
var psel = m_phost.ActiveView.ColumnAxis.Label;
psel.Caption = inadvcolcap.value;
fnerrorchk(psel);
}
function fnadvdatacap()
{
var psel = m_phost.ActiveView.DataAxis.Label;
psel.Caption = inadvdatacap.value;
fnerrorchk(psel);
}
function fnadvfilcap()
{
var psel = m_phost.ActiveView.FilterAxis.Label;
psel.Caption = inadvfilcap.value;
fnerrorchk(psel);
}
function fncapfont()
{
var prc = m_phost.ActiveView.RowAxis.Label;
var pcc = m_phost.ActiveView.ColumnAxis.Label;
var pdc = m_phost.ActiveView.DataAxis.Label;
var pfc = m_phost.ActiveView.FilterAxis.Label;
prc.Font.Color = tdcapfontbox.style.backgroundColor;
pcc.Font.Color = tdcapfontbox.style.backgroundColor;
pdc.Font.Color = tdcapfontbox.style.backgroundColor;
pfc.Font.Color = tdcapfontbox.style.backgroundColor;
fnerrorchk(prc);
fnerrorchk(pcc);
fnerrorchk(pdc);
fnerrorchk(pfc);
}
function fncapbold()
{
var prc = m_phost.ActiveView.RowAxis.Label.Font;
var pcc = m_phost.ActiveView.ColumnAxis.Label.Font;
var pdc = m_phost.ActiveView.DataAxis.Label.Font;
var pfc = m_phost.ActiveView.FilterAxis.Label.Font;
var fbold = false;
if(!prc.Bold || !pcc.Bold || !pdc.Bold || !pfc.Bold)
fbold = true;
prc.Bold = fbold;
pcc.Bold= fbold;
pdc.Bold= fbold;
pfc.Bold= fbold;
fnerrorchk(prc);
fnerrorchk(pcc);
fnerrorchk(pdc);
fnerrorchk(pfc);
}
function fncapital()
{
var prc = m_phost.ActiveView.RowAxis.Label.Font;
var pcc = m_phost.ActiveView.ColumnAxis.Label.Font;
var pdc = m_phost.ActiveView.DataAxis.Label.Font;
var pfc = m_phost.ActiveView.FilterAxis.Label.Font;
var fItalic= false;
if(!prc.Italic || !pcc.Italic || !pdc.Italic || !pfc.Italic )
fItalic= true;
prc.Italic= fItalic;
pcc.Italic= fItalic;
pdc.Italic= fItalic;
pfc.Italic= fItalic;
fnerrorchk(prc);
fnerrorchk(pcc);
fnerrorchk(pdc);
fnerrorchk(pfc);
}
function fncapunderline()
{
var prc = m_phost.ActiveView.RowAxis.Label.Font;
var pcc = m_phost.ActiveView.ColumnAxis.Label.Font;
var pdc = m_phost.ActiveView.DataAxis.Label.Font;
var pfc = m_phost.ActiveView.FilterAxis.Label.Font;
var fUnderline = false;
if(!prc.Underline || !pcc.Underline || !pdc.Underline || !pfc.Underline )
fUnderline = true;
prc.Underline = fUnderline ;
pcc.Underline = fUnderline ;
pdc.Underline = fUnderline ;
pfc.Underline = fUnderline ;
fnerrorchk(prc);
fnerrorchk(pcc);
fnerrorchk(pdc);
fnerrorchk(pfc);
}
function fncapfontcng()
{
var prc = m_phost.ActiveView.RowAxis.Label.Font;
var pcc = m_phost.ActiveView.ColumnAxis.Label.Font;
var pdc = m_phost.ActiveView.DataAxis.Label.Font;
var pfc = m_phost.ActiveView.FilterAxis.Label.Font;
prc.Name = slcapfontlist.value;
pcc.Name = slcapfontlist.value;
pdc.Name = slcapfontlist.value;
pfc.Name = slcapfontlist.value;
fnerrorchk(prc);
fnerrorchk(pcc);
fnerrorchk(pdc);
fnerrorchk(pfc);
}
function fncapfontsize()
{
var prc = m_phost.ActiveView.RowAxis.Label.Font;
var pcc = m_phost.ActiveView.ColumnAxis.Label.Font;
var pdc = m_phost.ActiveView.DataAxis.Label.Font;
var pfc = m_phost.ActiveView.FilterAxis.Label.Font;
prc.Size= slcapfontsize.value;
pcc.Size= slcapfontsize.value;
pdc.Size= slcapfontsize.value;
pfc.Size= slcapfontsize.value;
fnerrorchk(prc);
fnerrorchk(pcc);
fnerrorchk(pdc);
fnerrorchk(pfc);
}
function fncapback()
{
var prc = m_phost.ActiveView.RowAxis.Label;
var pcc = m_phost.ActiveView.ColumnAxis.Label;
var pdc = m_phost.ActiveView.DataAxis.Label;
var pfc = m_phost.ActiveView.FilterAxis.Label;
prc.BackColor = tdcapbackbox.style.backgroundColor;
pcc.BackColor = tdcapbackbox.style.backgroundColor;
pdc.BackColor = tdcapbackbox.style.backgroundColor;
pfc.BackColor = tdcapbackbox.style.backgroundColor;
fnerrorchk(prc);
fnerrorchk(pcc);
fnerrorchk(pdc);
fnerrorchk(pfc);
}
function fnadvdetails()
{
m_phost.AllowDetails = idadvdet.checked;
fnerrorchk(m_phost);
}
function fnadvfilter()
{
m_phost.AllowFiltering = !inadvfil.checked;
fnerrorchk(m_phost);
}
function fnadvgrp()
{
m_phost.AllowGrouping = !inadvgrp.checked;
fnerrorchk(m_phost);
}
function fnadvprop()
{
m_phost.AllowPropertyToolbox = inadvprop.checked;
fnerrorchk(m_phost);
}
function fnadvautofit()
{
m_phost.AutoFit = inadvautofit.checked;
fnerrorchk(m_phost);
}
function fnadvheight()
{
m_phost.MaxHeight = inadvmaxheight.value;
fnerrorchk(m_phost);
}
function fnadvwidth()
{
m_phost.MaxWidth = inadvmaxwidth.value;
fnerrorchk(m_phost);
}
function fnadvdetavail()
{
m_phost.HasDetails = inadvdetavail.checked;
fnerrorchk(m_phost);
}
function fnadvrtl()
{
m_phost.RightToLeft = inadvrtl.checked;
fnerrorchk(m_phost);
}
function fndatasrcrb()
{
inadvconn.value = "";
sladvdatasource.disabled = false;
sladvdatasource.value = m_iDSC;
inadvconn.disabled = true;
buttconnedit.disabled = true;
inadvconn.style.backgroundColor = "buttonface";
sladvdatasource.style.backgroundColor = "";
indatamem.checked = true;
indatatext.disabled = true;
fndatamemrb();
}
function fndatastrrb()
{
inadvconn.value = m_strConn;
sladvdatasource.value = -1;
sladvdatasource.disabled = true;
inadvconn.disabled = false;
buttconnedit.disabled = false;
inadvconn.style.backgroundColor = "";
sladvdatasource.style.backgroundColor = "buttonface";
if (m_phost.ProviderType == 3)
indatatext.disabled = true;
else
indatatext.disabled = false;
}
function fndatamemrb()
{
inadvcommand.value = "";
sladvdatamember.disabled =false;
fnsetselect(m_phost.DataMember, sladvdatamember);
inadvcommand.disabled = true;
sladvdatamember.style.backgroundColor = "";
inadvcommand.style.backgroundColor = "buttonface";
}
function fndatatextrb()
{
inadvcommand.value = m_strCommand;
sladvdatamember.value = -1;
sladvdatamember.disabled = true;
inadvcommand.disabled = false;
sladvdatamember.style.backgroundColor = "buttonface";
inadvcommand.style.backgroundColor = "";
}
function cleardsc()
{
if (m_iDSC >= 0)
{
var ees = m_pDSC[m_iDSC].ElementExtensions;
var nCountEES = ees.Count;
for (var index = 0; index < nCountEES; index++)
{
if (ees(index).ElementID == m_phost.Parent.ID)
{
ees.Delete (index);
break;
}
}
}
}
function fnconneditor()
{
var strConn;
cleardsc();
m_phost.LocateDataSource();
strConn = m_phost.ConnectionString;
if (strConn != "" && m_strConn != strConn)
{
inadvconn.value = strConn;
m_strConn = strConn;
fnclearopts(sladvdatamember);
if (m_phost.DataSource != null)
{
sladvdatasource.value = -1;
fnsetdmopts(m_phost.DataSource);
}
}
}
function fnadvconn()
{
if (m_strConn == inadvconn.value)
return;
m_strConn = inadvconn.value;
m_phost.DataSource=null;
cleardsc();
if (inadvconn.value == "")
m_phost.ConnectionString = "";
else
m_phost.ConnectionString = inadvconn.value;
var fError = fnerrorchk(m_phost);
fnclearopts(sladvdatamember);
if (inadvconn.value != "" && m_phost.DataSource != null)
{
sladvdatasource.value = -1;
if (!fError)
fnsetdmopts(m_phost.DataSource);
}
}
function fnadvcommand()
{
if (m_strCommand == inadvcommand.value)
return;
m_strCommand = inadvcommand.value;
m_phost.CommandText = inadvcommand.value;
fnerrorchk(m_phost);
sladvdatamember.value = -1;
}
function fnadvds()
{
var pDSCCur;
if (sladvdatasource.value == -1)
{
m_phost.DataSource = ""
m_phost.ConnectionString = m_strConn;
inadvconn.value = m_strConn;
fnsetdmopts(m_phost.DataSource);
return;
}
else if (sladvdatasource.value == "")
return;
cleardsc();
pDSCCur = m_pDSC[sladvdatasource.value];
m_phost.DataSource = pDSCCur.Object;
if (fnerrorchk(m_phost))
return;
m_phost.ConnectionString = "";
inadvconn.value="";
m_iDSC = sladvdatasource.value;
m_pDSC[sladvdatasource.value].ElementExtensions.Add (m_phost.Parent.ID);
m_pDSC[sladvdatasource.value].ElementExtensions(m_phost.Parent.ID).ConsumesRecordset = true;
fnerrorchk(m_phost);
fnsetdmopts(m_pDSC[sladvdatasource.value]);
}
function fnsetdmopts(pDSCCur)
{
var i;
var nCount;
var stName;
fnclearopts(sladvdatamember);
if (pDSCCur == null)
{
return;
}
var strings;
var data;
strings = null;
strings = m_phost.DataMemberStrings;
if (fInDataUpdate && m_phost.LastErrorValue != 0)
return;
if (!fnerrorchk(m_phost) && strings != null)
{
data = strings.toArray();
var i;
var count;
for (i = 0, count = data.length ; i < count; i++)
fnpivotaddopts(sladvdatamember, data[i], data[i]);
}
}
function fnadvdm()
{
var pDSCCur;
pDSCCur = m_pDSC[sladvdatasource.value];
if ((indatadsc.checked && pDSCCur == null) || (indatastr.checked && m_strConn == ""))
return;
m_strDataMember = sladvdatamember.value;
m_phost.DataMember = "";
m_phost.DataMember = sladvdatamember.value;
fnerrorchk(m_phost);
inadvcommand.value = "";
}
function fnmemadvae()
{
m_phost.MemberExpand = inmemadvae.value;
}
function fnfontsel()
{
switch(m_iseltype)
{
case 0:
return m_phost.ActiveView;
case 1:
return m_Selection;
case 2:
return m_phost.ActiveView;
case 3:
return m_phost.ActiveView;
case 4:
return m_Selection0.Field;
defualt:
return null;
}
}
function fnalignsel()
{
switch(m_iseltype)
{
case 0:
return m_phost.ActiveView;
case 1:
return m_Selection;
case 2:
return m_Selection;
case 3:
return m_phost.ActiveView;
defualt:
return null;
}
}
function fnfontswitch(psel)
{
switch(m_iseltype)
{
case 0:
return psel.FieldLabelFont;
case 1:
var pfs = psel.FieldSet;
if(pfs == null)
return;
if (psel.FieldSet.Orientation & 7)
return m_phost.ActiveView.FieldLabelFont;
else
return psel.DetailFont;
case 2:
return psel.TotalFont;
case 3:
return psel.MemberFont;
case 4:
return psel.SubtotalFont;
default:
return null;
}
}
function fnbgswitch(psel,clr)
{
switch(m_iseltype)
{
case 0:
psel.FieldLabelBackColor = clr;
return psel;
case 1:
if (psel.FieldSet.Orientation & 7)
m_phost.ActiveView.FieldLabelBackColor = clr;
else
psel.DetailBackColor = clr;
return psel;
case 2:
psel.TotalBackColor = clr;
return psel;
case 3:
psel.MemberBackColor = clr;
return psel;
case 4:
psel.SubtotalBackColor = clr;
return psel;
default:
return null;
}
}
function fnvalignswitch(psel,val)
{
switch(m_iseltype)
{
case 1:
psel.DetailVAlignment = val ;
break;
case 2:
psel.TotalVAlignment = val;
break;
case 3:
psel.MemberVAlignment = val;
break;
case 4:
psel.SubtotalVAlignment = val;
break;
default:
break;
}
return psel;
}
function fnhalignswitch(psel,val)
{
switch(m_iseltype)
{
case 1:
psel.DetailHAlignment = val;
break;
case 2:
psel.HAlignment = val;
break;
case 3:
psel.MemberHAlignment = val;
break;
case 4:
psel.SubtotalHAlignment =val;
break;
default:
break;
}
return psel;
}
function fnhval(psel)
{
var val;
switch(m_iseltype)
{
case 1:
val = psel.DetailHAlignment;
break;
case 2:
val = psel.TotalHAlignment;
break;
case 3:
val = psel.MemberHAlignment;
break;
case 4:
val = psel.SubtotalHAlignment;
break;
default:
break;
}
return val;
}
function fnvval(psel)
{
var val;
switch(m_iseltype)
{
case 1:
val = psel.DetailVAlignment;
break;
case 2:
val = psel.TotalVAlignment;
break;
case 3:
val = psel.MemberVAlignment;
break;
case 4:
val = psel.SubtotalVAlignment;
break;
default:
break;
}
return val;
}
function fnselectdisp(idisp)
{
var dispmap,i;
if (window == null)
return;
if (window.m_ppanels == null)
return;
var iln = window.m_ppanels.length;
for(i=0;i<iln;i++)
{
dispmap = (m_ilastdisp^idisp);
if((dispmap >> i) & 1)
{
if(((dispmap & idisp) >> i) & 1)
{
window.m_ppanels[i].style.display = "";
if(window.m_ppanels[i].State)
window.m_ppanels[i].Panel.style.display = "";
}
else
{
window.m_ppanels[i].style.display = "none";
window.m_ppanels[i].Panel.style.display = "none";
}
}
}
m_ilastdisp = idisp;
}
function fnGetPanels()
{
return m_ppanels;
}
function fnpopulatedatasources()
{
var par;
par = null;
if (m_phost == null)
{
return;
}
par = m_phost.Parent;
if (par == null)
{
return;
}
var rgDocCol,i,iln,fHasDSC;
var stDisplay, stConn;
var dscCur;
m_pDSC = new Array();
fnclearopts(sladvdatasource);
fnclearopts(sladvdatamember);
m_strConn = m_phost.ConnectionString;
m_strCommand = m_phost.CommandText;
m_iDSC = -1;
m_strDataMember = "";
if (m_strConn != "")
{
indatastr.checked = true;
fndatastrrb();
}
else
{
indatadsc.checked = true;
fndatasrcrb();
}
if (m_phost.Parent.Document == null)
{
if (m_strCommand != "" && m_phost.ProviderType != 3)
{
indatatext.checked = true;
fndatatextrb();
}
else
{
indatamem.checked = true;
fnsetdmopts(m_phost.DataSource);
fndatamemrb();
}
return;
}
dscCur = m_phost.DataSource;
rgDocCol = m_phost.Parent.Document.All.tags("OBJECT");
fnerrorchk(m_phost);
fHasDSC = false;
iln = rgDocCol.length;
for(i = 0;i < iln;i++)
{
if (rgDocCol[i] != null && rgDocCol[i].classid.search("0002E530-0000-0000-C000-000000000046") > 0)
{
m_pDSC[m_pDSC.length] = rgDocCol[i];
fHasDSC = true
}
}
if (fHasDSC || dscCur != null)
{
iln = m_pDSC.length;
for (i = 0; i < iln; i++)
{
stDisplay = m_pDSC[i].id
fnpivotaddopts(sladvdatasource, stDisplay, i);
if (dscCur != null && dscCur.ConnectionString == m_pDSC[i].ConnectionString)
{
sladvdatasource.value = i;
m_iDSC = i;
}
}
fnsetdmopts(m_phost.DataSource);
}
if (m_strCommand != "" && m_phost.ProviderType != 3)
{
indatatext.checked = true;
fndatatextrb();
}
else
{
indatamem.checked = true;
fndatamemrb();
if (m_phost.ProviderType == 3)
indatatext.disabled = true;
else if (!indatadsc.checked)
indatatext.disabled = false;
}
}
function IsFunctionValid(enumDataType, enumFunction)
{
if (enumFunction == 0 ||
enumFunction == 5 ||
enumFunction == 6 ||
enumFunction == 7)
return false;
switch (enumDataType)
{
case 16:
case 2:
case 3:
case 20:
case 17:
case 18:
case 19:
case 21:
case 4:
case 5:
case 6:
case 14:
case 131:
case 11:
case 139:
return true;
case 7:
case 133:
case 134:
case 135:
return (enumFunction == 2 || enumFunction == 3 || enumFunction == 4);
}
return (enumFunction == 2);
}
function fnDataTypeStr(enumDataType)
{
switch (enumDataType)
{
case 0: return divDTEmpty.innerText;
case 1: return divDTNull.innerText;
case 2: return divDTSmallInt.innerText;
case 3: return divDTInteger.innerText;
case 4: return divDTSingle.innerText;
case 5: return divDTDouble.innerText;
case 6: return divDTCurrency.innerText;
case 7: return divDTDate.innerText;
case 8: return divDTBSTR.innerText;
case 9: return divDTIDispatch.innerText;
case 10: return divDTError.innerText;
case 11: return divDTBoolean.innerText;
case 12: return divDTVariant.innerText;
case 13: return divDTIUnknown.innerText;
case 14: return divDTDecimal.innerText;
case 16: return divDTTinyInt.innerText;
case 17: return divDTUnsignedTinyInt.innerText;
case 18: return divDTUnsignedSmallInt.innerText;
case 19: return divDTUnsignedInt.innerText;
case 20: return divDTBigInt.innerText;
case 21: return divDTUnsignedBigInt.innerText;
case 64: return divDTFileTime.innerText;
case 72: return divDTGUID.innerText;
case 128: return divDTBinary.innerText;
case 129: return divDTChar.innerText;
case 130: return divDTWChar.innerText;
case 131: return divDTNumeric.innerText;
case 132: return divDTUserDefined.innerText;
case 133: return divDTDBDate.innerText;
case 134: return divDTDBTime.innerText;
case 135: return divDTDBTimeStamp.innerText;
case 136: return divDTChapter.innerText;
case 137: return divDTDBFileTime.innerText;
case 138: return divDTPropVariant.innerText;
case 139: return divDTVarNumeric.innerText;
case 200: return divDTVarChar.innerText;
case 201: return divDTLongVarChar.innerText;
case 202: return divDTVarWChar.innerText;
case 203: return divDTLongVarWChar.innerText;
case 204: return divDTVarBinary.innerText;
case 205: return divDTLongVarBinary.innerText;
default: return "";
}
}
function fnFieldTypeStr(enumDataType)
{
switch (enumDataType)
{
case 1: return divDTTypeRegular.innerText;
case 2: return divDTTypeCalculated.innerText;
case 3: return divDTTypeTime.innerText;
case 4: return divDTTypeTimeYears.innerText;
case 5: return divDTTypeTimeHalfYears.innerText;
case 6: return divDTTypeTimeQuarters.innerText;
case 7: return divDTTypeTimeMonths.innerText;
case 8: return divDTTypeTimeWeeks.innerText;
case 9: return divDTTypeTimeDays.innerText;
case 10: return divDTTypeTimeHours.innerText;
case 11: return divDTTypeTimeMinutes.innerText;
case 12: return divDTTypeTimeSeconds.innerText;
case 13: return divDTTypeTimeUndefined.innerText;
case 14: return divDTTypeUnknown.innerText;
case 15: return divDTTypeUserDefined.innerText;
default: return "";
}
}
function fnFieldSetTypeStr(enumDataType)
{
switch (enumDataType)
{
case 3: return divDTFieldSetTypeUnknown.innerText;
case 1: return divDTFieldSetTypeTime.innerText;
case 4: return divDTFieldSetTypeUserDefined.innerText;
case 2: return divDTFieldSetTypeOther.innerText;
default: return "";
}
}
function fnFieldSetOrientation(enumDataType)
{
switch (enumDataType)
{
case 0: return divDTOrientationNone.innerText;
case 1: return divDTOrientationColumnAxis.innerText;
case 2: return divDTOrientationRowAxis.innerText;
case 4: return divDTOrientationFilterAxis.innerText;
case 8: return divDTOrientationDataAxis.innerText;
default: return "";
}
}